import 'package:flutter/material.dart';
import 'package:qh_music/src/shared/mixins/l10n.dart';

enum PlayMode {
  sequence(icon: Icon(Icons.wrap_text)),
  single(icon: Icon(Icons.repeat_one)),
  loop(icon: Icon(Icons.repeat)),
  shuffle(icon: Icon(Icons.shuffle));

  final Icon icon;

  const PlayMode({required this.icon});
}

extension PlaylistModeExtension on PlayMode {
  String getText(BuildContext context) {
    switch (this) {
      case PlayMode.sequence:
        return context.l10n.sequencePlay;
      case PlayMode.single:
        return context.l10n.singlePlay;
      case PlayMode.loop:
        return context.l10n.loopPlay;
      case PlayMode.shuffle:
        return context.l10n.shufflePlay;
    }
  }
}
